﻿using System.Collections.Generic;

namespace LuKou.Web.BLL.Extensions
{
    /// <summary>
    /// 分页列表
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagedList<T> : List<T>
    {
        /// <summary>
        /// 当前分页
        /// </summary>
        public int PageIndex { get; private set; }
        /// <summary>
        /// 显示数据条目
        /// </summary>
        public int PageSize { get; private set; }
        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalCount { get; private set; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        public PagedList(IEnumerable<T> source, int pageIndex, int pageSize, int totalCount)
        {
            PageIndex = pageIndex;
            PageSize = pageSize;
            TotalCount = totalCount;
            if (null != source)
            {
                AddRange(source);
            }
        }
    }
}
